// PaintElement.h: interface for the CPaintElement class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_PAINTELEMENT_H__66CA8CEA_9A36_4E88_95BE_0119B7FE4000__INCLUDED_)
#define AFX_PAINTELEMENT_H__66CA8CEA_9A36_4E88_95BE_0119B7FE4000__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000





#define POS_OUTSIDE 0
#define POS_INSIDE  1
#define POS_BOTTOMRIGHT  2

#define FRAME_RECTSIZE 6

#define MIN_SIZE  5

#define VAR_NOT_FOUND -1


class CPaintElement  
{
public:
	BOOL IsChanged();
	void SetChangedFlag(BOOL isChanged=TRUE);

	void PaintError(CDC *pdc,CString S);
	void Serialize(CArchive* par);

	int FindVar(CString Var);
	void SetSize(CPoint P);


	CArray<CString,CString> m_Var; 
	CArray<CString,CString> m_Value;


	void PaintNumber(CDC* pdc);

	static void CALLBACK DelVar(CString Var,void* pElement);
    static CString CALLBACK GetVar(CString Var,void* pElement);
	static void CALLBACK SetVar(CString Var,CString Value,void* pElement);

	void SettingsDialog();

	void About();
	CString m_DllFileName;
	void SetPos(CPoint point);
	BOOL IsInside(CPoint point);
	CRect m_pos;
	void Clear();
	void Free();

	BOOL Paint(CDC* pdc);
	HINSTANCE m_hDLL;
	BOOL Init();
	CPaintElement();
	virtual ~CPaintElement();

	typedef BOOL ( WINAPI*  DLL_Paint) (CDC*, CRect*,void*,void*, void*);
	typedef void ( WINAPI*  DLL_About) (void*,void*, void*);
	typedef void ( WINAPI*  DLL_Init) (void*,void*, void*);
	typedef void ( WINAPI*  DLL_Settings) (void*,void*, void*);

	DLL_Paint p_Paint;
	int m_Number;
protected:
	BOOL m_isChanged;
	
};

#endif // !defined(AFX_PAINTELEMENT_H__66CA8CEA_9A36_4E88_95BE_0119B7FE4000__INCLUDED_)
